import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

import 'package:pull_to_refresh/pull_to_refresh.dart';

class AppWidgetRefresh extends StatelessWidget {
  final Widget child;
  const AppWidgetRefresh({super.key, required this.child});
  @override
  Widget build(BuildContext context) {
    return RefreshConfiguration(
      // headerTriggerDistance: 100,
      // springDescription:
      //     const SpringDescription(stiffness: 170, damping: 16, mass: 1.9),
      enableScrollWhenRefreshCompleted: true,
      enableLoadingWhenFailed: true,
      hideFooterWhenNotFull: false,
      enableBallisticLoad: true,
      headerBuilder: () => const ClassicHeader(
        height: 80,
        refreshStyle: RefreshStyle.UnFollow,
      ),
      footerBuilder: () => const ClassicFooter(
        height: 80,
      ),
      child: child,
    );
  }
}
